import JSHOP2.*;

public class problem
{
	private static String[] defineConstants()
	{
		String[] problemConstants = new String[7];

		problemConstants[0] = "cario";
		problemConstants[1] = "usa";
		problemConstants[2] = "departed";
		problemConstants[3] = "returndate";
		problemConstants[4] = "availablerooms";
		problemConstants[5] = "stars";
		problemConstants[6] = "name";

		return problemConstants;
	}

	private static void createState0(State s)	{
		s.add(new Predicate(0, 0, new TermList(TermConstant.getConstant(6), TermList.NIL)));
		s.add(new Predicate(1, 0, new TermList(TermConstant.getConstant(7), TermList.NIL)));
		s.add(new Predicate(4, 0, new TermList(TermConstant.getConstant(6), TermList.NIL)));
	}

	public static void main(String[] args) throws InterruptedException
	{
		TermConstant.initialize(13);

		Domain d = new webservices();

		d.setProblemConstants(defineConstants());

		State s = new State(6, d.getAxioms());

		JSHOP2.initialize(d, s);

		TaskList tl;
		Thread thread;

		createState0(s);

		tl = new TaskList(2, true);
		tl.subtasks[0] = new TaskList(2, true);
		tl.subtasks[0].subtasks[0] = new TaskList(1, true);
		tl.subtasks[0].subtasks[0].subtasks[0] = new TaskList(new TaskAtom(new Predicate(0, 0, TermList.NIL), false, false));
		tl.subtasks[0].subtasks[1] = new TaskList(1, true);
		tl.subtasks[0].subtasks[1].subtasks[0] = new TaskList(new TaskAtom(new Predicate(2, 0, TermList.NIL), false, false));
		tl.subtasks[1] = new TaskList(new TaskAtom(new Predicate(3, 0, TermList.NIL), false, false));

		thread = new SolverThread(tl, 1);
		thread.start();
		while (thread.isAlive())
			Thread.sleep(500);
	}
}